#ifndef ALIANALYSISTASKPERFORMANCESTRANGE_H
#define ALIANALYSISTASKPERFORMANCESTRANGE_H

/*  See cxx source for full Copyright notice */

//-----------------------------------------------------------------
//	        AliAnalysisTaskPerformanceSrange class
//    This task is for a performance study of V0 identification.
//                It works with MC info and ESD tree.
//                 Author: H.Ricaud, H.Ricaud@gsi.de
//-----------------------------------------------------------------

class TString;
class TList;
class TH1F;
class TH2F;

#include "AliAnalysisTaskSE.h"

class AliAnalysisTaskPerformanceStrange : public AliAnalysisTaskSE {
 public:
  AliAnalysisTaskPerformanceStrange();
  AliAnalysisTaskPerformanceStrange(const char *name);
  virtual ~AliAnalysisTaskPerformanceStrange() {}
  
  virtual void   UserCreateOutputObjects();
  virtual void   UserExec(Option_t *option);
  virtual void   Terminate(Option_t *);
 
  void   SetCollidingSystems(Int_t collidingSystems = 0) {fCollidingSystems = collidingSystems;}
  void   SetAnalysisMC(Int_t analysisMC) {fAnalysisMC = analysisMC;}
  void   SetAnalysisType(const char* analysisType) {fAnalysisType = analysisType;}
  void   SetUsePID(const char* usePID) {fUsePID = usePID;}
  void   SetAnalysisCut(const char* useCut) {fUseCut = useCut;}
  Double_t MyRapidity(Double_t rE, Double_t rPz) const;
  Double_t MyEta(Double_t p1, Double_t p2, Double_t p3) const;
//  Double_t Cosine (Double_t* r1, Double_t* r2) const; 
 private:
  Int_t        fAnalysisMC;                     //  0->No MC or 1->MC analysis
  TString      fAnalysisType;                   //  "ESD" or "AOD"
  Int_t        fCollidingSystems;               //  Colliding systems 0/1 for pp/PbPb  
  TString      fUsePID;                         //  "withPID" or "noPID"
  TString      fUseCut;                         //  "yes" or "no"

  AliPhysicsSelection *fPhysTrigSel;            //  Selection of events
  TTree	      *fTree;


  Double_t DCA_L[1500];
  Double_t MASS_L[1500];
  Double_t CPA_L[1500];
  Double_t IP1_L[1500];
  Double_t IP2_L[1500];
  Double_t VERTEXx_L[1500];
  Double_t VERTEXy_L[1500];
  Double_t VERTEXz_L[1500];
  Double_t DAUGHTER1_MOMx_L[1500]; // always pos first
  Double_t DAUGHTER1_MOMy_L[1500];
  Double_t DAUGHTER1_MOMz_L[1500];
  Double_t DAUGHTER2_MOMx_L[1500];
  Double_t DAUGHTER2_MOMy_L[1500];
  Double_t DAUGHTER2_MOMz_L[1500];
  Double_t MOMENTUMx_L[1500];
  Double_t MOMENTUMy_L[1500];
  Double_t MOMENTUMz_L[1500];
  Double_t PVERTEXx;
  Double_t PVERTEXy;
  Double_t PVERTEXz;
  Int_t INDEX1_L[1500];
  Int_t INDEX2_L[1500];

  Double_t DCA_D[1500];
  Double_t MASS_D[1500];
  Double_t IP1_D[1500];
  Double_t IP2_D[1500];
  Double_t VERTEXx_D[1500];
  Double_t VERTEXy_D[1500];
  Double_t VERTEXz_D[1500];
  Double_t DAUGHTER1_MOMx_D[1500]; // always pos first
  Double_t DAUGHTER1_MOMy_D[1500];
  Double_t DAUGHTER1_MOMz_D[1500];
  Double_t DAUGHTER2_MOMx_D[1500];
  Double_t DAUGHTER2_MOMy_D[1500];
  Double_t DAUGHTER2_MOMz_D[1500];
  Double_t MOMENTUMx_D[1500];
  Double_t MOMENTUMy_D[1500];
  Double_t MOMENTUMz_D[1500];
  Int_t INDEX1_D[1500];
  Int_t INDEX2_D[1500];

  Int_t RunNumber;
  Int_t EventNumber;
  Int_t NPAIR_L; 
  Int_t NPAIR_D;


  TBranch    *fRunNumber;
  TBranch    *fEventNumber;
  TBranch    *fNPAIR_L;
  TBranch    *fDCA_L;
  TBranch    *fIP1_L;          // IP of pos, neg trki
  TBranch    *fIP2_L;          // IP of pos, neg trk
  TBranch    *fMASS_L;
  TBranch    *fVERTEXx_L;
  TBranch    *fVERTEXy_L;
  TBranch    *fVERTEXz_L;
  TBranch    *fCPA_L;
  TBranch    *fINDEX1_L;
  TBranch    *fINDEX2_L;
  TBranch    *fMOMENTUMx_L;
  TBranch    *fMOMENTUMy_L;
  TBranch    *fMOMENTUMz_L;
  TBranch    *fDAUGHTER1_MOMx_L;
  TBranch    *fDAUGHTER1_MOMy_L;
  TBranch    *fDAUGHTER1_MOMz_L;
  TBranch    *fDAUGHTER2_MOMx_L;
  TBranch    *fDAUGHTER2_MOMy_L;
  TBranch    *fDAUGHTER2_MOMz_L;


  TBranch    *fPVERTEXx;
  TBranch    *fPVERTEXy;
  TBranch    *fPVERTEXz;


  TBranch    *fNPAIR_D;
  TBranch    *fDCA_D;
  TBranch    *fIP1_D;          // IP of pos, neg trki
  TBranch    *fIP2_D;          // IP of pos, neg trk
  TBranch    *fMASS_D;
  TBranch    *fVERTEXx_D;
  TBranch    *fVERTEXy_D;
  TBranch    *fVERTEXz_D;
  TBranch    *fINDEX1_D;
  TBranch    *fINDEX2_D;
  TBranch    *fMOMENTUMx_D;
  TBranch    *fMOMENTUMy_D;
  TBranch    *fMOMENTUMz_D;
  TBranch    *fDAUGHTER1_MOMx_D;
  TBranch    *fDAUGHTER1_MOMy_D;
  TBranch    *fDAUGHTER1_MOMz_D;
  TBranch    *fDAUGHTER2_MOMx_D;
  TBranch    *fDAUGHTER2_MOMy_D;
  TBranch    *fDAUGHTER2_MOMz_D;





                                                                                                                               



  AliAnalysisTaskPerformanceStrange(const AliAnalysisTaskPerformanceStrange&); 
  AliAnalysisTaskPerformanceStrange& operator=(const AliAnalysisTaskPerformanceStrange&); 

  ClassDef(AliAnalysisTaskPerformanceStrange, 1); 
};

#endif



